#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

void fun(int* p, size_t sz)
{
	int left = 0;
	size_t hight = sz;
	while (left < hight)
	{
		while ((left < hight) && (*(p + left) % 2 != 0))
		{
			left++;
		}
		while ((hight > left) && (*(p + hight) % 2 == 0))
		{
			hight--;
		}
		int tmp = *(p + left);
		*(p + left) = *(p + hight);
		*(p + hight) = tmp;
	}
}

int main()
{
	int arr[100] = { 0 };
	for(int i = 0; i < 5; i++)
	{
		scanf ("%d", &arr[i]);
	}
	size_t sz = sizeof(arr) / sizeof(arr[0]);
	fun(arr, sz);
	for (int i = 0; i < 5; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}